using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection.Emit;

namespace CodeGenTest
{
    public class OperationTreeList
    {
    }

    public class OperationTreeNode : IEquatable<OperationTreeNode>
    {
        public readonly Expr value;
        public readonly string name;
        public readonly LocalBuilder reference;
        private bool evaluated;

        public OperationTreeNode(Expr value, string name)
        {
            this.value = value;
            this.name = name;
        }

        public bool Equals(OperationTreeNode operationTreeNode)
        {
            if (operationTreeNode == null) return false;
            return Equals(name, operationTreeNode.name);
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(this, obj)) return true;
            return Equals(obj as OperationTreeNode);
        }

        public override int GetHashCode()
        {
            return name.GetHashCode();
        }
    }
}
